The development of USB cable provides a way of supplying power from a charger (for example, a host system) to an electronic device. However, different USB cables may have different resistances, which generate different voltage drops across the USB cables when the battery of the electronic device is charged by the charger via the USB cables, respectively. Thus, the voltage output to the battery may not be satisfied when using an unmatched USB cable.